package com.itheima.servlet;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class UserServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String opt = req.getParameter("opt");
        if("save".equals(opt))
            save(req,resp);
        if("delete".equals(opt))
            delete(req,resp);
        if("update".equals(opt))
            update(req,resp);
        if("find".equals(opt))
            find(req,resp);
    }

    private void save(HttpServletRequest req, HttpServletResponse resp) {
        System.out.println("添加");
    }
    private void delete(HttpServletRequest req, HttpServletResponse resp) {
        System.out.println("删除");
    }
    private void update(HttpServletRequest req, HttpServletResponse resp) {
        System.out.println("更新");
    }
    private void find(HttpServletRequest req, HttpServletResponse resp) {
        System.out.println("查看");
    }


}
